package com.rede.didiok.user.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rede.didiok.common.enums.StatusEnum;
import com.rede.didiok.user.entity.TodoEntity;

/**
 * 代办事项表
 * 
 * @author Rede
 * @email didiok@foxmail.com
 * @date 2023-08-07 18:21:17
 */
@Mapper
public interface TodoDao extends BaseMapper<TodoEntity> {


    /**
     * 批量更新未删除的代表事项的状态
     *
     * @param done
     */
    @Select("UPDATE u_todo SET done = #{done} WHERE STATUS = " + StatusEnum.ENABLE + " AND admin_uid = #{adminUid}")
    public void toggleAll(@Param("done") Integer done, @Param("adminUid") String adminUid);

}
